<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>珊菇凉, 生日快乐!</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<style type="text/css">
		@font-face {
			font-family: digit;
			src: url('digital-7_mono.ttf') format("truetype");
		}
	</style>
	<link href="css/default.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/garden.js"></script>
    <script type="text/javascript" src="js/functions.js"></script>
</head>

<body>
	<div id="mainDiv">
		<div id="content">
			<div id="code">
				<span class="comments">/**</span><br />
				<span class="space"/><span class="comments"  style="font-size:20px">* 爱原来很容易,</span><br />
				<span class="space"/><span class="comments">* Your number was u the first time I met you.</span><br />
				<span class="space"/><span class="comments">*/</span><br />
				Boy i = <span class="keyword">new</span> Boy(<span class="string">"冬枣"</span>);<br />
				Girl u = <span class="keyword">new</span> Girl(<span class="string">"珊菇凉"</span>);<br />
				<span class="comments">// January 6, 2019, I told you I love you. </span><br />
				i.love(u);<br />
				<span class="comments">// Luckily, you accepted and became my girlfriend eversince.</span><br />
				u.accepted();<br />
				<span class="comments">// 曾几何时，在众说纷纭中彷徨.</span><br />
				i.miss(u);<br />
				<span class="comments">// 曾几何时，没有找到幸福的坚强.</span><br />
				i.takeCareOf(u);<br />
				<span class="comments">// 直到你的出现，生命中有了照亮前路的阳光，我爱你！.</span><br />
				<span class="comments">// 不论天涯海角，我的灵魂在你那里，爱你的心不离不弃。.</span><br />
				<span class="keyword">boolean</span> isHesitate = <span class="keyword">true</span>;<br />
				<span class="keyword">while</span> (isHesitate) {<br />
				<span class="placeholder"/>i.waitFor(u);<br />
				<span class="placeholder"/><span class="comments">//生日快乐,你永远都是最美的</span><br />
				<span class="placeholder"/><span class="comments">//不长,只此一生.</span><br />
				<span class="placeholder"/>isHesitate = u.thinkOver();<br />
				}<br />
				<span class="comments" style="font-size:10px">// 我爱你.</span><br />
				<span class="comments" style="font-size:15px">// 我爱你.</span><br />
				<span class="comments" style="font-size:20px">// 我爱你.</span><br />
				<span class="comments">//  I feel very protective of you.</span><br />
				i.marry(u);<br />
				i.liveHappilyWith(u);<br />
			</div>
			<div id="loveHeart">
				<canvas id="garden"></canvas>
				<div id="words">
					<div id="messages">
						珊菇凉, I have fallen in love with you for,happy birthday!
						<div id="elapseClock"></div>
					</div>
					<div id="loveu">
						Love u forever and ever.<br/>
						<div class="signature">- 冬枣</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var offsetX = $("#loveHeart").width() / 2;
		var offsetY = $("#loveHeart").height() / 2 - 55;
		var together = new Date();
		together.setFullYear(2018, 11, 30); //时间年月日
						//year	必需。表示年份的四位整数。用本地时间表示。
						//month	可选。表示月份的数值，介于 0 ~ 11 之间。用本地时间表示。
						//day	可选。表示月中某一天的数值，介于 1 ~ 31 之间。用本地时间表示。
		together.setHours(19); //设置 Date 对象中的小时 (0 ~ 23)。
		together.setMinutes(0); //设置 Date 对象中的分钟 (0 ~ 59)。
		together.setSeconds(0); //设置 Date 对象中的秒钟 (0 ~ 59)。
		together.setMilliseconds(0); //设置 Date 对象中的毫秒 (0 ~ 999)。
		
		if (!document.createElement('canvas').getContext) {
			var msg = document.createElement("div");
			msg.id = "errorMsg";
			msg.innerHTML = "Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+"; 
			document.body.appendChild(msg);
			$("#code").css("display", "none")
			$("#copyright").css("position", "absolute");
			$("#copyright").css("bottom", "10px");
		    document.execCommand("stop");
		} else {
			setTimeout(function () {
				startHeartAnimation();
			}, 5000);

			timeElapse(together);
			setInterval(function () {
				timeElapse(together);
			}, 500);

			adjustCodePosition();
			$("#code").typewriter();
		}
	</script>
	<audio id="bgmMusic" src="2020.mp3" preload="auto" type="audio/mp3" autoplay loop></audio>
	<script language="javascript" type="text/javascript">
        function autoPlay() {
            var myAuto = document.getElementById('bgmMusic');
            myAuto.play();
        }
        function closePlay() {
            var myAuto = document.getElementById('bgmMusic');
            myAuto.pause();
            //myAuto.load();
        }
    </script>
</body>
</html>
